/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2024-08-22 16:10:33
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2024-08-22 17:55:27
 * @FilePath: /vue3-uniapp/src/mock/index.ts
 */
import type { UnResponse, UnData } from '@uni-helper/uni-network';

import { myResponse } from './my';
import { commonResponse } from './common';
import { orderCaseResponse } from './orderCase';
import { orderAssignResponse } from './orderAssign';

export const mockAdapter = (url?: string, param?: unknown) => {
    let res: Promise<UnResponse<UnData, UnData>> | undefined = myResponse(
        url,
        param
    );
    if (res === undefined) {
        res = commonResponse(url, param);
    }
    if (res === undefined) {
        res = orderCaseResponse(url, param);
    }
    if (res === undefined) {
        res = orderAssignResponse(url, param);
    }
    return res;
};
